//
//  HPYNetworkTools.swift
//  SwiftVVBo
//
//  Created by hepeiyong on 16/8/14.
//  Copyright © 2016年 hpyhn. All rights reserved.
//

import UIKit
// 相当于OC中的pch文件
// 切换根控制器通知名字
let WBSWITCHROOTVCNOTIFICATION = "WBSWITCHROOTVCNOTIFICATION"
// 微博账号
let WBName = "18539396112"
let WBPassWd = "lkmfuk5368"
// 微博相关信息
let WBAppKey = "902030745"
let WBAppSecret = "0280c54c597b23651e68117cbb987374"
let WBRedirect_uri = "http://m.weibo.cn"

// 屏幕的宽&高
let SCREENW = UIScreen.mainScreen().bounds.width
let SCREENH = UIScreen.mainScreen().bounds.height



// 主题颜色
let AppThemeColor = UIColor.orangeColor()
// RGB颜色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1)-> UIColor{
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}
// 随机颜色
func RandomColor()-> UIColor{
    let r = CGFloat(random()%256)
    let g = CGFloat(random()%256)
    let b = CGFloat(random()%256)
    return RGB(r, green: g, blue: b)
}
/**
 自定义打印

 - parameter message:  内容
 - parameter file:     类名
 - parameter function: 方法名
 - parameter line:     行数
 */
func printLog<T>(message: T, file: String = #file, function: String = #function,line: Int =  #line){
//    #if DEBUG
        let newFile = (file as NSString).lastPathComponent
        let result = "\(newFile) [\(line)] \(function) : \(message)"
        print(result)
//    #endif
}